<template>
  <div class="section-list">
    <ul>
      <li v-for="(item, index) in data" :key="index" @click="click(item.path)">
        <span>{{ item.name }}</span>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  props: {
    data: Array,
  },
  methods: {
    click(path) {
      this.$emit('link', path)
    }
  }
}
</script>

<style>
/* 章节 */
.section-list {
  font-size: 14px;
}

.section-list>ul>li {
  line-height: 46px;
  padding: 0 15px;
  border-top: 1px dotted #998D80;
  white-space: nowrap;
}

.section-list>ul>li>span {
  display: block;
  text-indent: 2em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.section-list>ul>li:first-child {
  border: 0;
}
</style>
